<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <!--测试v-on-->
    <div id="example-1">
        <button v-on:click="counter += 1">Add</button>
        <p>按钮被点击了{{ counter }}次</p>
    </div>

    <br>

    <div id="example-2">
        <!--采用绑定方法的方式-->
        <button v-on:click="greet">点我试试</button>
    </div>

    <br>

    <div id="example-3">
        <button v-on:click="say('Python')">Python</button>
        <button v-on:click="say('Java')">Java</button>
        <button v-on:click="warn('提交了', $event)">Submit</button><!--访问原始的 DOM 事件。可以用特殊变量 $event 把它传入方法-->
    </div>

</body>
<script src="../js/event.js"></script>
</html>